from django.shortcuts import render
from django.db.models import Q
from django.shortcuts import redirect
from django.shortcuts import HttpResponse
from . import models
from random import shuffle
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.utils import timezone


def index(request):

    return render(request, 'Pages/index.html', locals())


def peoples(request):
    director = models.Member.objects.get(identity="主任")
    vdirector = models.Member.objects.filter(identity="副主任").order_by("name")
    secretary = models.Member.objects.get(identity="秘书长")
    vsecretary = models.Member.objects.filter(identity="副秘书长").order_by("name")
    cmember = models.Member.objects.filter(identity="常务委员").order_by("name")
    member = models.Member.objects.filter(identity="委员").order_by("name")
    return render(request, 'Pages/peoples.html', locals())


def news(request):

    return render(request, 'Pages/news.html', locals())

def about(request):

    return render(request, 'Pages/about.html', locals())

